<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/qt3support/widgets/q3mainwindow.cpp -->
<head>
  <title>Qt 4.3: Q3MainWindow Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">Q3MainWindow Class Reference<br /><sup><sup>[<a href="qt3support.html">Qt3Support</a> module]</sup></sup></h1>
<p>The Q3MainWindow class provides a main application window, with a menu bar, dock windows (e.g&#x2e; for toolbars), and a status bar. <a href="#details">More...</a></p>
<pre> #include &lt;Q3MainWindow&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html#qmainwindow">Porting to Qt 4</a> for more information.</p>
<p>Inherits <a href="qwidget.html">QWidget</a>.</p>
<ul>
<li><a href="q3mainwindow-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h3>Public Types</h3>
<ul>
<li><div class="fn"/>enum <b><a href="q3mainwindow.html#DockWindows-enum">DockWindows</a></b> { OnlyToolBars, NoToolBars, AllDockWindows }</li>
</ul>
<a name="properties"></a>
<h3>Properties</h3>
<p><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"/><b><a href="q3mainwindow.html#dockWindowsMovable-prop">dockWindowsMovable</a></b> : bool</li>
<li><div class="fn"/><b><a href="q3mainwindow.html#opaqueMoving-prop">opaqueMoving</a></b> : bool</li>
<li><div class="fn"/><b><a href="q3mainwindow.html#rightJustification-prop">rightJustification</a></b> : bool</li>
</ul></td><td valign="top"><ul>
<li><div class="fn"/><b><a href="q3mainwindow.html#usesBigPixmaps-prop">usesBigPixmaps</a></b> : bool</li>
<li><div class="fn"/><b><a href="q3mainwindow.html#usesTextLabel-prop">usesTextLabel</a></b> : bool</li>
</ul>
</td></tr>
</table></p>
<ul>
<li><div class="fn"/>56 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="q3mainwindow.html#Q3MainWindow">Q3MainWindow</a></b> ( QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0, Qt::WindowFlags <i>f</i> = Qt::WType_TopLevel )</li>
<li><div class="fn"/><b><a href="q3mainwindow.html#dtor.Q3MainWindow">~Q3MainWindow</a></b> ()</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#addDockWindow">addDockWindow</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>edge</i> = Qt::DockTop, bool <i>newLine</i> = false )</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#addDockWindow-2">addDockWindow</a></b> ( Q3DockWindow * <i>dockWindow</i>, const QString &amp; <i>label</i>, Qt::Dock <i>edge</i> = Qt::DockTop, bool <i>newLine</i> = false )</li>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#addToolBar">addToolBar</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>position</i> = Qt::DockTop, bool <i>newLine</i> = false )</li>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#addToolBar-2">addToolBar</a></b> ( Q3DockWindow * <i>dockWindow</i>, const QString &amp; <i>label</i>, Qt::Dock <i>position</i> = Qt::DockTop, bool <i>newLine</i> = false )</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#appropriate">appropriate</a></b> ( Q3DockWindow * <i>dw</i> ) const</li>
<li><div class="fn"/>Q3DockArea * <b><a href="q3mainwindow.html#bottomDock">bottomDock</a></b> () const</li>
<li><div class="fn"/>QWidget * <b><a href="q3mainwindow.html#centralWidget">centralWidget</a></b> () const</li>
<li><div class="fn"/>virtual Q3PopupMenu * <b><a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a></b> ( DockWindows <i>dockWindows</i> = AllDockWindows ) const</li>
<li><div class="fn"/>QList&lt;Q3DockWindow *&gt; <b><a href="q3mainwindow.html#dockWindows">dockWindows</a></b> ( Qt::Dock <i>dock</i> ) const</li>
<li><div class="fn"/>QList&lt;Q3DockWindow *&gt; <b><a href="q3mainwindow.html#dockWindows-2">dockWindows</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#dockWindowsMovable-prop">dockWindowsMovable</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#getLocation">getLocation</a></b> ( Q3DockWindow * <i>dw</i>, Qt::Dock &amp; <i>dock</i>, int &amp; <i>index</i>, bool &amp; <i>nl</i>, int &amp; <i>extraOffset</i> ) const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#hasDockWindow">hasDockWindow</a></b> ( Q3DockWindow * <i>dw</i> )</li>
<li><div class="fn"/>virtual bool <b><a href="q3mainwindow.html#isCustomizable">isCustomizable</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#isDockEnabled">isDockEnabled</a></b> ( Qt::Dock <i>dock</i> ) const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#isDockEnabled-2">isDockEnabled</a></b> ( Q3DockArea * <i>area</i> ) const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#isDockEnabled-3">isDockEnabled</a></b> ( Q3DockWindow * <i>dw</i>, Q3DockArea * <i>area</i> ) const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#isDockEnabled-4">isDockEnabled</a></b> ( Q3DockWindow * <i>tb</i>, Qt::Dock <i>dock</i> ) const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#isDockMenuEnabled">isDockMenuEnabled</a></b> () const</li>
<li><div class="fn"/>Q3DockArea * <b><a href="q3mainwindow.html#leftDock">leftDock</a></b> () const</li>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#lineUpDockWindows">lineUpDockWindows</a></b> ( bool <i>keepNewLines</i> = false )</li>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#lineUpToolBars">lineUpToolBars</a></b> ( bool <i>keepNewLines</i> = false )</li>
<li><div class="fn"/>QMenuBar * <b><a href="q3mainwindow.html#menuBar">menuBar</a></b> () const</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#moveDockWindow">moveDockWindow</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>edge</i> = Qt::DockTop )</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#moveDockWindow-2">moveDockWindow</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>edge</i>, bool <i>nl</i>, int <i>index</i>, int <i>extraOffset</i> = -1 )</li>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#moveToolBar">moveToolBar</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>position</i> = Qt::DockTop )</li>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#moveToolBar-2">moveToolBar</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>position</i>, bool <i>nl</i>, int <i>index</i>, int <i>extraOffset</i> = -1 )</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#opaqueMoving-prop">opaqueMoving</a></b> () const</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#removeDockWindow">removeDockWindow</a></b> ( Q3DockWindow * <i>dockWindow</i> )</li>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#removeToolBar">removeToolBar</a></b> ( Q3DockWindow * <i>dockWindow</i> )</li>
<li><div class="fn"/>Q3DockArea * <b><a href="q3mainwindow.html#rightDock">rightDock</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#rightJustification-prop">rightJustification</a></b> () const</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setCentralWidget">setCentralWidget</a></b> ( QWidget * <i>w</i> )</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a></b> ( Qt::Dock <i>dock</i>, bool <i>enable</i> )</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setDockEnabled-2">setDockEnabled</a></b> ( Q3DockWindow * <i>dw</i>, Qt::Dock <i>dock</i>, bool <i>enable</i> )</li>
<li><div class="fn"/>QStatusBar * <b><a href="q3mainwindow.html#statusBar">statusBar</a></b> () const</li>
<li><div class="fn"/>QList&lt;Q3ToolBar *&gt; <b><a href="q3mainwindow.html#toolBars">toolBars</a></b> ( Qt::Dock <i>dock</i> ) const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#toolBarsMovable">toolBarsMovable</a></b> () const</li>
<li><div class="fn"/>Q3DockArea * <b><a href="q3mainwindow.html#topDock">topDock</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#usesBigPixmaps-prop">usesBigPixmaps</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#usesTextLabel-prop">usesTextLabel</a></b> () const</li>
</ul>
<ul>
<li><div class="fn"/>201 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div class="fn"/>12 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h3>Public Slots</h3>
<ul>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#customize">customize</a></b> ()</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setAppropriate">setAppropriate</a></b> ( Q3DockWindow * <i>dw</i>, bool <i>a</i> )</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setDockMenuEnabled">setDockMenuEnabled</a></b> ( bool <i>b</i> )</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#dockWindowsMovable-prop">setDockWindowsMovable</a></b> ( bool )</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#opaqueMoving-prop">setOpaqueMoving</a></b> ( bool )</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#rightJustification-prop">setRightJustification</a></b> ( bool )</li>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#setToolBarsMovable">setToolBarsMovable</a></b> ( bool <i>b</i> )</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#usesBigPixmaps-prop">setUsesBigPixmaps</a></b> ( bool )</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#usesTextLabel-prop">setUsesTextLabel</a></b> ( bool )</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#whatsThis">whatsThis</a></b> ()</li>
</ul>
<ul>
<li><div class="fn"/>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h3>Signals</h3>
<ul>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#dockWindowPositionChanged">dockWindowPositionChanged</a></b> ( Q3DockWindow * <i>dockWindow</i> )</li>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#pixmapSizeChanged">pixmapSizeChanged</a></b> ( bool <i>b</i> )</li>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#toolBarPositionChanged">toolBarPositionChanged</a></b> ( Q3ToolBar * <i>toolbar</i> )</li>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#usesTextLabelChanged">usesTextLabelChanged</a></b> ( bool <i>b</i> )</li>
</ul>
<ul>
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h3>Protected Functions</h3>
<ul>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#childEvent">childEvent</a></b> ( QChildEvent * <i>e</i> )</li>
</ul>
<ul>
<li><div class="fn"/>38 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"/>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<a name="protected-slots"></a>
<h3>Protected Slots</h3>
<ul>
<li><div class="fn"/>void <b><a href="q3mainwindow.html#menuAboutToShow">menuAboutToShow</a></b> ()</li>
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setUpLayout">setUpLayout</a></b> ()</li>
<li><div class="fn"/>virtual bool <b><a href="q3mainwindow.html#showDockMenu">showDockMenu</a></b> ( const QPoint &amp; <i>globalPos</i> )</li>
</ul>
<ul>
<li><div class="fn"/>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="related-non-members"></a>
<h3>Related Non-Members</h3>
<ul>
<li><div class="fn"/>QTextStream &amp; <b><a href="q3mainwindow.html#operator-lt-lt-118">operator&lt;&lt;</a></b> ( QTextStream &amp; <i>ts</i>, const Q3MainWindow &amp; <i>mainWindow</i> )</li>
<li><div class="fn"/>QTextStream &amp; <b><a href="q3mainwindow.html#operator-gt-gt-68">operator&gt;&gt;</a></b> ( QTextStream &amp; <i>ts</i>, Q3MainWindow &amp; <i>mainWindow</i> )</li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"/>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The Q3MainWindow class provides a main application window, with a menu bar, dock windows (e.g&#x2e; for toolbars), and a status bar.</p>
<p>Main windows are most often used to provide menus, toolbars and a status bar around a large central widget, such as a text edit, drawing canvas or <a href="qworkspace.html">QWorkspace</a> (for MDI applications). Q3MainWindow is usually subclassed since this makes it easier to encapsulate the central widget, menus and toolbars as well as the window's state. Subclassing makes it possible to create the slots that are called when the user clicks menu items or toolbar buttons.</p>
<p>We'll briefly review adding menu items and toolbar buttons then describe the facilities of Q3MainWindow itself.</p>
<pre> Q3MainWindow *mw = new Q3MainWindow;
 QTextEdit *edit = new QTextEdit(mw, &quot;editor&quot;);
 edit-&gt;setFocus();
 mw-&gt;setWindowTitle(&quot;Main Window&quot;);
 mw-&gt;setCentralWidget(edit);
 mw-&gt;show();</pre>
<p>Q3MainWindows may be created in their own right as shown above. The central widget is set with <a href="q3mainwindow.html#setCentralWidget">setCentralWidget</a>(). Popup menus can be added to the default menu bar, widgets can be added to the status bar, toolbars and dock windows can be added to any of the dock areas.</p>
<p>The main window will take care of the dock areas, and the geometry of the central widget, but all other aspects of the central widget are left to you. Q3MainWindow automatically detects the creation of a menu bar or status bar if you specify the Q3MainWindow as parent, or you can use the provided <a href="q3mainwindow.html#menuBar">menuBar</a>() and <a href="q3mainwindow.html#statusBar">statusBar</a>() functions. The functions <a href="q3mainwindow.html#menuBar">menuBar</a>() and <a href="q3mainwindow.html#statusBar">statusBar</a>() create a suitable widget if one doesn't exist, and update the window's layout to make space.</p>
<p>New dock windows and toolbars can be added to a Q3MainWindow using <a href="q3mainwindow.html#addDockWindow">addDockWindow</a>(). <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> windows can be moved using <a href="q3mainwindow.html#moveDockWindow">moveDockWindow</a>() and removed with <a href="q3mainwindow.html#removeDockWindow">removeDockWindow</a>(). Q3MainWindow allows default dock window (toolbar) docking in all its dock areas (<tt>Top</tt>, <tt>Left</tt>, <tt>Right</tt>, <tt>Bottom</tt>). You can use <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>() to enable and disable docking areas for dock windows. When adding or moving dock windows you can specify their 'edge' (dock area). The currently available edges are: <tt>Top</tt>, <tt>Left</tt>, <tt>Right</tt>, <tt>Bottom</tt>, <tt>Minimized</tt> (effectively a 'hidden' dock area) and <tt>TornOff</tt> (floating). See <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> for an explanation of these areas. Note that the *ToolBar functions are included for backward compatibility; all new code should use the *DockWindow functions. <a href="porting4.html#qtoolbar">QToolbar</a> is a subclass of <a href="q3dockwindow.html">Q3DockWindow</a> so all functions that work with dock windows work on toolbars in the same way.</p>
<a name="dwm"></a><p>If the user clicks the close button, then the dock window is hidden. A dock window can be hidden or unhidden by the user by right clicking a dock area and clicking the name of the relevant dock window on the pop up dock window menu. This menu lists the names of every dock window; visible dock windows have a tick beside their names. The dock window menu is created automatically as required by <a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a>(). Since it may not always be appropriate for a dock window to appear on this menu the <a href="q3mainwindow.html#setAppropriate">setAppropriate</a>() function is used to inform the main window whether or not the dock window menu should include a particular dock window. Double clicking a dock window handle (usually on the left-hand side of the dock window) undocks (floats) the dock window. Double clicking a floating dock window's title bar will dock the floating dock window. (See also <a href="q3mainwindow.html#DockWindows-enum">Q3MainWindow::DockWindows</a>.)</p>
<p>Some functions change the appearance of a Q3MainWindow globally:</p>
<ul>
<li><a href="q3dockwindow.html#setHorizontalStretchable">Q3DockWindow::setHorizontalStretchable</a>() and <a href="q3dockwindow.html#setVerticalStretchable">Q3DockWindow::setVerticalStretchable</a>() are used to make specific dock windows or toolbars stretchable.</li>
<li><a href="q3mainwindow.html#usesBigPixmaps-prop">setUsesBigPixmaps</a>() is used to set whether tool buttons should draw small or large pixmaps (see <a href="qicon.html">QIcon</a> for more information).</li>
<li><a href="q3mainwindow.html#usesTextLabel-prop">setUsesTextLabel</a>() is used to set whether tool buttons should display a textual label in addition to pixmaps (see <a href="qtoolbutton.html">QToolButton</a> for more information).</li>
</ul>
<p>The user can drag dock windows into any enabled docking area. <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> windows can also be dragged <i>within</i> a docking area, for example to rearrange the order of some toolbars. <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> windows can also be dragged outside any docking area (undocked or 'floated'). Being able to drag dock windows can be enabled (the default) and disabled using <a href="q3mainwindow.html#dockWindowsMovable-prop">setDockWindowsMovable</a>().</p>
<p>The <tt>Minimized</tt> edge is a hidden dock area. If this dock area is enabled the user can hide (minimize) a dock window or show (restore) a minimized dock window by clicking the dock window handle. If the user hovers the mouse cursor over one of the handles, the caption of the dock window is displayed in a tool tip (see <a href="q3dockwindow.html#windowTitle">Q3DockWindow::windowTitle</a>() or <a href="q3toolbar.html#label-prop">Q3ToolBar::label</a>()), so if you enable the <tt>Minimized</tt> dock area, it is best to specify a meaningful caption or label for each dock window. To minimize a dock window programmatically use <a href="q3mainwindow.html#moveDockWindow">moveDockWindow</a>() with an edge of <tt>Minimized</tt>.</p>
<p><a href="qt-qt3.html#Dock-enum">Qt::Dock</a> windows are moved transparently by default, i.e&#x2e; during the drag an outline rectangle is drawn on the screen representing the position of the dock window as it moves. If you want the dock window to be shown normally whilst it is moved use <a href="q3mainwindow.html#opaqueMoving-prop">setOpaqueMoving</a>().</p>
<p>The location of a dock window, i.e&#x2e; its dock area and position within the dock area, can be determined by calling <a href="q3mainwindow.html#getLocation">getLocation</a>(). Movable dock windows can be lined up to minimize wasted space with <a href="q3mainwindow.html#lineUpDockWindows">lineUpDockWindows</a>(). Pointers to the dock areas are available from <a href="q3mainwindow.html#topDock">topDock</a>(), <a href="q3mainwindow.html#leftDock">leftDock</a>(), <a href="q3mainwindow.html#rightDock">rightDock</a>() and <a href="q3mainwindow.html#bottomDock">bottomDock</a>(). A customize menu item is added to the pop up dock window menu if <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() returns true; it returns false by default. Reimplement <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() and <a href="q3mainwindow.html#customize">customize</a>() if you want to offer this extra menu item, for example, to allow the user to change settings relating to the main window and its toolbars and dock windows.</p>
<p>The main window's menu bar is fixed (at the top) by default. If you want a movable menu bar, create a <a href="qmenubar.html">QMenuBar</a> as a stretchable widget inside its own movable dock window and restrict this dock window to only live within the <tt>Top</tt> or <tt>Bottom</tt> dock:</p>
<pre> Q3ToolBar *tb = new Q3ToolBar(this);
 addDockWindow(tb, tr(&quot;Menubar&quot;), Top, false);
 QMenuBar *mb = new QMenuBar(tb);
 mb-&gt;setFrameStyle(QFrame::NoFrame);
 tb-&gt;setStretchableWidget(mb);
 setDockEnabled(tb, Left, false);
 setDockEnabled(tb, Right, false);</pre>
<p>An application with multiple dock windows can choose to save the current dock window layout in order to restore it later, e.g&#x2e; in the next session. You can do this by using the streaming operators for Q3MainWindow.</p>
<p>To save the layout and positions of all the dock windows do this:</p>
<pre> QFile file(filename);
 if (file.open(IO_WriteOnly)) {
     QTextStream stream(&amp;file);
     stream &lt;&lt; *mainWindow;
     file.close();
 }</pre>
<p>To restore the dock window positions and sizes (normally when the application is next started), do the following:</p>
<pre> QFile file(filename);
 if (file.open(IO_ReadOnly)) {
     QTextStream stream(&amp;file);
     stream &gt;&gt; *mainWindow;
     file.close();
 }</pre>
<p>The <a href="qsettings.html">QSettings</a> class can be used in conjunction with the streaming operators to store the application's settings.</p>
<p>Q3MainWindow's management of dock windows and toolbars is done transparently behind-the-scenes by <a href="q3dockarea.html">Q3DockArea</a>.</p>
<p>For multi-document interfaces (MDI), use a <a href="qworkspace.html">QWorkspace</a> as the central widget.</p>
<p>Adding dock windows, e.g&#x2e; toolbars, to Q3MainWindow's dock areas is straightforward. If the supplied dock areas are not sufficient for your application we suggest that you create a <a href="qwidget.html">QWidget</a> subclass and add your own dock areas (see <a href="q3dockarea.html">Q3DockArea</a>) to the subclass since Q3MainWindow provides functionality specific to the standard dock areas it provides.</p>
<p>See also <a href="q3toolbar.html">Q3ToolBar</a>, <a href="q3dockwindow.html">Q3DockWindow</a>, <a href="qstatusbar.html">QStatusBar</a>, <a href="qaction.html">QAction</a>, <a href="qmenubar.html">QMenuBar</a>, <a href="q3popupmenu.html">Q3PopupMenu</a>, and <a href="qdialog.html">QDialog</a>.</p>
<hr />
<h2>Member Type Documentation</h2>
<h3 class="fn"><a name="DockWindows-enum"></a>enum Q3MainWindow::DockWindows</h3>
<p>Right-clicking a dock area will pop-up the dock window menu (<a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a>() is called automatically). When called in code you can specify what items should appear on the menu with this enum.</p>
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>Q3MainWindow::OnlyToolBars</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The menu will list all the toolbars, but not any other dock windows.</td></tr>
<tr><td valign="top"><tt>Q3MainWindow::NoToolBars</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The menu will list dock windows but not toolbars.</td></tr>
<tr><td valign="top"><tt>Q3MainWindow::AllDockWindows</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">The menu will list all toolbars and other dock windows. (This is the default.)</td></tr>
</table></p>
<hr />
<h2>Property Documentation</h2>
<h3 class="fn"><a name="dockWindowsMovable-prop"></a>dockWindowsMovable : bool</h3>
<p>This property holds whether the dock windows are movable.</p>
<p>If true (the default), the user will be able to move movable dock windows from one <a href="q3mainwindow.html">Q3MainWindow</a> dock area to another, including the <tt>TearOff</tt> area (i.e&#x2e; where the dock window floats freely as a window in its own right), and the <tt>Minimized</tt> area (where only the dock window's handle is shown below the menu bar). Movable dock windows can also be moved within <a href="q3mainwindow.html">Q3MainWindow</a> dock areas, i.e&#x2e; to rearrange them within a dock area.</p>
<p>If false the user will not be able to move any dock windows.</p>
<p>By default dock windows are moved transparently (i.e&#x2e; only an outline rectangle is shown during the drag), but this setting can be changed with <a href="q3mainwindow.html#opaqueMoving-prop">setOpaqueMoving</a>().</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>bool dockWindowsMovable () const</b></li>
<li><div class="fn"/><b>virtual void setDockWindowsMovable ( bool )</b></li>
</ul>
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>() and <a href="q3mainwindow.html#opaqueMoving-prop">setOpaqueMoving</a>().</p>
<h3 class="fn"><a name="opaqueMoving-prop"></a>opaqueMoving : bool</h3>
<p>This property holds whether dock windows are moved opaquely.</p>
<p>If true the dock windows of the main window are shown opaquely (i.e&#x2e; it shows the toolbar as it looks when docked) whilst it is being moved. If false (the default) they are shown transparently, (i.e&#x2e; as an outline rectangle).</p>
<p><b>Warning:</b> Opaque moving of toolbars and dockwindows is known to have several problems. We recommend avoiding the use of this feature for the time being. We intend fixing the problems in a future release.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>bool opaqueMoving () const</b></li>
<li><div class="fn"/><b>virtual void setOpaqueMoving ( bool )</b></li>
</ul>
<h3 class="fn"><a name="rightJustification-prop"></a>rightJustification : bool</h3>
<p>This property holds whether the main window right-justifies its dock windows.</p>
<p>If disabled (the default), stretchable dock windows are expanded, and non-stretchable dock windows are given the minimum space they need. Since most dock windows are not stretchable, this usually results in an unjustified right edge (or unjustified bottom edge for a vertical dock area). If enabled, the main window will right-justify its dock windows.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>bool rightJustification () const</b></li>
<li><div class="fn"/><b>virtual void setRightJustification ( bool )</b></li>
</ul>
<p>See also <a href="q3dockwindow.html#setVerticalStretchable">Q3DockWindow::setVerticalStretchable</a>() and <a href="q3dockwindow.html#setHorizontalStretchable">Q3DockWindow::setHorizontalStretchable</a>().</p>
<h3 class="fn"><a name="usesBigPixmaps-prop"></a>usesBigPixmaps : bool</h3>
<p>This property holds whether big pixmaps are enabled.</p>
<p>If false (the default), the tool buttons will use small pixmaps; otherwise big pixmaps will be used.</p>
<p>Tool buttons and other widgets that wish to respond to this setting are responsible for reading the correct state on startup, and for connecting to the main window's widget's <a href="q3mainwindow.html#pixmapSizeChanged">pixmapSizeChanged</a>() signal.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>bool usesBigPixmaps () const</b></li>
<li><div class="fn"/><b>virtual void setUsesBigPixmaps ( bool )</b></li>
</ul>
<h3 class="fn"><a name="usesTextLabel-prop"></a>usesTextLabel : bool</h3>
<p>This property holds whether text labels for toolbar buttons are enabled.</p>
<p>If disabled (the default), the tool buttons will not use text labels. If enabled, text labels will be used.</p>
<p>Tool buttons and other widgets that wish to respond to this setting are responsible for reading the correct state on startup, and for connecting to the main window's widget's <a href="q3mainwindow.html#usesTextLabelChanged">usesTextLabelChanged</a>() signal.</p>
<p>Access functions:</p>
<ul>
<li><div class="fn"/><b>bool usesTextLabel () const</b></li>
<li><div class="fn"/><b>virtual void setUsesTextLabel ( bool )</b></li>
</ul>
<p>See also <a href="qtoolbutton-qt3.html#setUsesTextLabel">QToolButton::setUsesTextLabel</a>().</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="Q3MainWindow"></a>Q3MainWindow::Q3MainWindow ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0, <a href="qt.html#WindowType-enum">Qt::WindowFlags</a> <i>f</i> = Qt::WType_TopLevel )</h3>
<p>Constructs an empty main window. The <i>parent</i>, <i>name</i> and widget flags <i>f</i>, are passed on to the <a href="qwidget.html">QWidget</a> constructor.</p>
<p>By default, the widget flags are set to <a href="qt.html#WindowType-enum">Qt::WType_TopLevel</a> rather than 0 as they are with <a href="qwidget.html">QWidget</a>. If you don't want your <a href="q3mainwindow.html">Q3MainWindow</a> to be a top level widget then you will need to set <i>f</i> to 0.</p>
<h3 class="fn"><a name="dtor.Q3MainWindow"></a>Q3MainWindow::~Q3MainWindow ()</h3>
<p>Destroys the object and frees any allocated resources.</p>
<h3 class="fn"><a name="addDockWindow"></a>void Q3MainWindow::addDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>edge</i> = Qt::DockTop, bool <i>newLine</i> = false )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Adds <i>dockWindow</i> to the <i>edge</i> dock area.</p>
<p>If <i>newLine</i> is false (the default) then the <i>dockWindow</i> is added at the end of the <i>edge</i>. For vertical edges the end is at the bottom, for horizontal edges (including <tt>Minimized</tt>) the end is at the right. If <i>newLine</i> is true a new line of dock windows is started with <i>dockWindow</i> as the first (left-most and top-most) dock window.</p>
<p>If <i>dockWindow</i> is managed by another main window, it is first removed from that window.</p>
<h3 class="fn"><a name="addDockWindow-2"></a>void Q3MainWindow::addDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, const <a href="qstring.html">QString</a> &amp; <i>label</i>, <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>edge</i> = Qt::DockTop, bool <i>newLine</i> = false )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Adds <i>dockWindow</i> to the dock area with label <i>label</i>.</p>
<p>If <i>newLine</i> is false (the default) the <i>dockWindow</i> is added at the end of the <i>edge</i>. For vertical edges the end is at the bottom, for horizontal edges (including <tt>Minimized</tt>) the end is at the right. If <i>newLine</i> is true a new line of dock windows is started with <i>dockWindow</i> as the first (left-most and top-most) dock window.</p>
<p>If <i>dockWindow</i> is managed by another main window, it is first removed from that window.</p>
<h3 class="fn"><a name="addToolBar"></a>void Q3MainWindow::addToolBar ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>position</i> = Qt::DockTop, bool <i>newLine</i> = false )</h3>
<p>Adds a new toolbar to the <i>dockWindow</i>. The toolbar is placed in the given <i>position</i>. If <i>newLine</i> is true the toolbar is put on a new line.</p>
<h3 class="fn"><a name="addToolBar-2"></a>void Q3MainWindow::addToolBar ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, const <a href="qstring.html">QString</a> &amp; <i>label</i>, <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>position</i> = Qt::DockTop, bool <i>newLine</i> = false )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>The toolbar has the caption <i>label</i> and is placed in the given <i>position</i>.</p>
<h3 class="fn"><a name="appropriate"></a>bool Q3MainWindow::appropriate ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i> ) const</h3>
<p>Returns true if it is appropriate to include a menu item for the <i>dw</i> dock window in the dock window menu; otherwise returns false.</p>
<p>The user is able to change the state (show or hide) a dock window that has a menu item by clicking the item.</p>
<p>Call <a href="q3mainwindow.html#setAppropriate">setAppropriate</a>() to indicate whether or not a particular dock window should appear on the popup menu.</p>
<p>See also <a href="q3mainwindow.html#setAppropriate">setAppropriate</a>().</p>
<h3 class="fn"><a name="bottomDock"></a><a href="q3dockarea.html">Q3DockArea</a> * Q3MainWindow::bottomDock () const</h3>
<p>Returns a pointer the <tt>Bottom</tt> dock area</p>
<p>See also <a href="q3mainwindow.html#topDock">topDock</a>(), <a href="q3mainwindow.html#leftDock">leftDock</a>(), and <a href="q3mainwindow.html#rightDock">rightDock</a>().</p>
<h3 class="fn"><a name="centralWidget"></a><a href="qwidget.html">QWidget</a> * Q3MainWindow::centralWidget () const</h3>
<p>Returns a pointer to the main window's central widget.</p>
<p>The central widget is surrounded by the left, top, right and bottom dock areas. The menu bar is above the top dock area.</p>
<p>See also <a href="q3mainwindow.html#setCentralWidget">setCentralWidget</a>().</p>
<h3 class="fn"><a name="childEvent"></a>void Q3MainWindow::childEvent ( <a href="qchildevent.html">QChildEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Monitors events, received in <i>e</i>, to ensure the layout is updated.</p>
<p>Reimplemented from <a href="qobject.html#childEvent">QObject</a>.</p>
<h3 class="fn"><a name="createDockWindowMenu"></a><a href="q3popupmenu.html">Q3PopupMenu</a> * Q3MainWindow::createDockWindowMenu ( <a href="q3mainwindow.html#DockWindows-enum">DockWindows</a> <i>dockWindows</i> = AllDockWindows ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Creates the dock window menu which contains all toolbars (if <i>dockWindows</i> is <tt>OnlyToolBars</tt>), all dock windows (if <i>dockWindows</i> is <tt>NoToolBars</tt>) or all toolbars and dock windows (if <i>dockWindows</i> is <tt>AllDockWindows</tt> - the default).</p>
<p>This function is called internally when necessary, e.g&#x2e; when the user right clicks a dock area (providing <a href="q3mainwindow.html#isDockMenuEnabled">isDockMenuEnabled</a>() returns true). You can reimplement this function if you wish to customize the behavior.</p>
<p>The menu items representing the toolbars and dock windows are checkable. The visible dock windows are checked and the hidden dock windows are unchecked. The user can click a menu item to change its state (show or hide the dock window).</p>
<p>The list and the state are always kept up-to-date.</p>
<p>Toolbars and dock windows which are not appropriate in the current context (see <a href="q3mainwindow.html#setAppropriate">setAppropriate</a>()) are not listed in the menu.</p>
<p>The menu also has a menu item for lining up the dock windows.</p>
<p>If <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() returns true, a Customize menu item is added to the menu, which if clicked will call <a href="q3mainwindow.html#customize">customize</a>(). The <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() function we provide returns false and <a href="q3mainwindow.html#customize">customize</a>() does nothing, so they must be reimplemented in a subclass to be useful.</p>
<h3 class="fn"><a name="customize"></a>void Q3MainWindow::customize ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
<p>This function is called when the user clicks the Customize menu item on the dock window menu.</p>
<p>The customize menu item will only appear if <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() returns true (it returns false by default).</p>
<p>The function is intended, for example, to provide the user with a means of telling the application that they wish to customize the main window, dock windows or dock areas.</p>
<p>The default implementation does nothing and the Customize menu item is not shown on the right-click menu by default. If you want the item to appear then reimplement <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() to return true, and reimplement this function to do whatever you want.</p>
<p>See also <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>().</p>
<h3 class="fn"><a name="dockWindowPositionChanged"></a>void Q3MainWindow::dockWindowPositionChanged ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the <i>dockWindow</i> has changed its position. A change in position occurs when a dock window is moved within its dock area or moved to another dock area (including the <tt>Minimized</tt> and <tt>TearOff</tt> dock areas).</p>
<p>See also <a href="q3mainwindow.html#getLocation">getLocation</a>().</p>
<h3 class="fn"><a name="dockWindows"></a><a href="qlist.html">QList</a>&lt;<a href="q3dockwindow.html">Q3DockWindow</a> *&gt; Q3MainWindow::dockWindows ( <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>dock</i> ) const</h3>
<p>Returns a list of all the dock windows which are in the <i>dock</i> dock area, regardless of their state.</p>
<p>For example, the <a href="qt-qt3.html#Dock-enum">Qt::DockTornOff</a> dock area may contain closed dock windows but these are returned along with the visible dock windows.</p>
<h3 class="fn"><a name="dockWindows-2"></a><a href="qlist.html">QList</a>&lt;<a href="q3dockwindow.html">Q3DockWindow</a> *&gt; Q3MainWindow::dockWindows () const</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns the list of dock windows which belong to this main window, regardless of which dock area they are in or what their state is, (e.g&#x2e; irrespective of whether they are visible or not).</p>
<h3 class="fn"><a name="getLocation"></a>bool Q3MainWindow::getLocation ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i>, <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> &amp; <i>dock</i>, int &amp; <i>index</i>, bool &amp; <i>nl</i>, int &amp; <i>extraOffset</i> ) const</h3>
<p>Finds the location of the dock window <i>dw</i>.</p>
<p>If the <i>dw</i> dock window is found in the main window the function returns true and populates the <i>dock</i> variable with the dw's dock area and the <i>index</i> with the dw's position within the dock area. It also sets <i>nl</i> to true if the <i>dw</i> begins a new line (otherwise false), and <i>extraOffset</i> with the dock window's offset.</p>
<p>If the <i>dw</i> dock window is not found then the function returns false and the state of <i>dock</i>, <i>index</i>, <i>nl</i> and <i>extraOffset</i> is undefined.</p>
<p>If you want to save and restore dock window positions then use operator&gt;&gt;() and operator&lt;&lt;().</p>
<h3 class="fn"><a name="hasDockWindow"></a>bool Q3MainWindow::hasDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i> )</h3>
<p>Returns true if <i>dw</i> is a dock window known to the main window; otherwise returns false.</p>
<h3 class="fn"><a name="isCustomizable"></a>bool Q3MainWindow::isCustomizable () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns true if the dock area dock window menu includes the Customize menu item (which calls <a href="q3mainwindow.html#customize">customize</a>() when clicked). Returns false by default, i.e&#x2e; the popup menu will not contain a Customize menu item. You will need to reimplement this function and set it to return true if you wish the user to be able to see the dock window menu.</p>
<p>See also <a href="q3mainwindow.html#customize">customize</a>().</p>
<h3 class="fn"><a name="isDockEnabled"></a>bool Q3MainWindow::isDockEnabled ( <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>dock</i> ) const</h3>
<p>Returns true if the <i>dock</i> dock area is enabled, i.e&#x2e; it can accept user dragged dock windows; otherwise returns false.</p>
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>().</p>
<h3 class="fn"><a name="isDockEnabled-2"></a>bool Q3MainWindow::isDockEnabled ( <a href="q3dockarea.html">Q3DockArea</a> * <i>area</i> ) const</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns true if dock area <i>area</i> is enabled, i.e&#x2e; it can accept user dragged dock windows; otherwise returns false.</p>
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>().</p>
<h3 class="fn"><a name="isDockEnabled-3"></a>bool Q3MainWindow::isDockEnabled ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i>, <a href="q3dockarea.html">Q3DockArea</a> * <i>area</i> ) const</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns true if dock area <i>area</i> is enabled for the dock window <i>dw</i>; otherwise returns false.</p>
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>().</p>
<h3 class="fn"><a name="isDockEnabled-4"></a>bool Q3MainWindow::isDockEnabled ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>tb</i>, <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>dock</i> ) const</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Returns true if dock area <i>dock</i> is enabled for the dock window <i>tb</i>; otherwise returns false.</p>
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>().</p>
<h3 class="fn"><a name="isDockMenuEnabled"></a>bool Q3MainWindow::isDockMenuEnabled () const</h3>
<p>Returns true, if the dock window menu is enabled; otherwise returns false.</p>
<p>The menu lists the (<a href="q3mainwindow.html#appropriate">appropriate</a>()) dock windows (which may be shown or hidden), and has a &quot;Line Up Dock Windows&quot; menu item. It will also have a &quot;Customize&quot; menu item if <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() returns true.</p>
<p><a href="q3mainwindow.html#setAppropriate">setAppropriate</a>()</p>
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>(), <a href="q3mainwindow.html#lineUpDockWindows">lineUpDockWindows</a>(), and <a href="q3mainwindow.html#appropriate">appropriate</a>().</p>
<h3 class="fn"><a name="leftDock"></a><a href="q3dockarea.html">Q3DockArea</a> * Q3MainWindow::leftDock () const</h3>
<p>Returns the <tt>Left</tt> dock area</p>
<p>See also <a href="q3mainwindow.html#rightDock">rightDock</a>(), <a href="q3mainwindow.html#topDock">topDock</a>(), and <a href="q3mainwindow.html#bottomDock">bottomDock</a>().</p>
<h3 class="fn"><a name="lineUpDockWindows"></a>void Q3MainWindow::lineUpDockWindows ( bool <i>keepNewLines</i> = false )</h3>
<p>This function will line up dock windows within the visible dock areas (<tt>Top</tt>, <tt>Left</tt>, <tt>Right</tt> and <tt>Bottom</tt>) as compactly as possible.</p>
<p>If <i>keepNewLines</i> is true, all dock windows stay on their original lines. If <i>keepNewLines</i> is false then newlines may be removed to achieve the most compact layout possible.</p>
<p>The method only works if <a href="q3mainwindow.html#dockWindowsMovable-prop">dockWindowsMovable</a>() returns true.</p>
<h3 class="fn"><a name="lineUpToolBars"></a>void Q3MainWindow::lineUpToolBars ( bool <i>keepNewLines</i> = false )</h3>
<p>Lines up the toolbars. Line breaks are preserved if <i>keepNewLines</i> is true.</p>
<h3 class="fn"><a name="menuAboutToShow"></a>void Q3MainWindow::menuAboutToShow ()&nbsp;&nbsp;<tt> [protected slot]</tt></h3>
<p>This slot is called from the aboutToShow() signal of the default dock menu of the mainwindow. The default implementation initializes the menu with all dock windows and toolbars in this slot.</p>
<h3 class="fn"><a name="menuBar"></a><a href="qmenubar.html">QMenuBar</a> * Q3MainWindow::menuBar () const</h3>
<p>Returns the menu bar for this window.</p>
<p>If there isn't one, then menuBar() creates an empty menu bar.</p>
<p>See also <a href="q3mainwindow.html#statusBar">statusBar</a>().</p>
<h3 class="fn"><a name="moveDockWindow"></a>void Q3MainWindow::moveDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>edge</i> = Qt::DockTop )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Moves <i>dockWindow</i> to the end of the <i>edge</i>.</p>
<p>For vertical edges the end is at the bottom, for horizontal edges (including <tt>Minimized</tt>) the end is at the right.</p>
<p>If <i>dockWindow</i> is managed by another main window, it is first removed from that window.</p>
<h3 class="fn"><a name="moveDockWindow-2"></a>void Q3MainWindow::moveDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>edge</i>, bool <i>nl</i>, int <i>index</i>, int <i>extraOffset</i> = -1 )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Moves <i>dockWindow</i> to position <i>index</i> within the <i>edge</i> dock area.</p>
<p>Any dock windows with positions <i>index</i> or higher have their position number incremented and any of these on the same line are moved right (down for vertical dock areas) to make room.</p>
<p>If <i>nl</i> is true, a new dock window line is created below the line in which the moved dock window appears and the moved dock window, with any others with higher positions on the same line, is moved to this new line.</p>
<p>The <i>extraOffset</i> is the space to put between the left side of the dock area (top side for vertical dock areas) and the dock window. (This is mostly used for restoring dock windows to the positions the user has dragged them to.)</p>
<p>If <i>dockWindow</i> is managed by another main window, it is first removed from that window.</p>
<h3 class="fn"><a name="moveToolBar"></a>void Q3MainWindow::moveToolBar ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>position</i> = Qt::DockTop )</h3>
<p>Moves the given <i>dockWindow</i> into the given <i>position</i>.</p>
<h3 class="fn"><a name="moveToolBar-2"></a>void Q3MainWindow::moveToolBar ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>position</i>, bool <i>nl</i>, int <i>index</i>, int <i>extraOffset</i> = -1 )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>The <i>dockWindow</i> is made the <i>index</i>-th item in the toolbar, moved over by <i>extraOffset</i>. If <i>nl</i> is true, the dock window is put on a new line.</p>
<h3 class="fn"><a name="pixmapSizeChanged"></a>void Q3MainWindow::pixmapSizeChanged ( bool <i>b</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the <a href="q3mainwindow.html#usesBigPixmaps-prop">setUsesBigPixmaps</a>() is called with a value different to the current setting. The new value is passed in <i>b</i>. All widgets that should respond to such changes, e.g&#x2e; toolbar buttons, must connect to this signal.</p>
<h3 class="fn"><a name="removeDockWindow"></a>void Q3MainWindow::removeDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Removes <i>dockWindow</i> from the main window's docking area, provided <i>dockWindow</i> is non-null and managed by this main window.</p>
<h3 class="fn"><a name="removeToolBar"></a>void Q3MainWindow::removeToolBar ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i> )</h3>
<p>Removes the toolbar from the given <i>dockWindow</i>.</p>
<h3 class="fn"><a name="rightDock"></a><a href="q3dockarea.html">Q3DockArea</a> * Q3MainWindow::rightDock () const</h3>
<p>Returns the <tt>Right</tt> dock area</p>
<p>See also <a href="q3mainwindow.html#leftDock">leftDock</a>(), <a href="q3mainwindow.html#topDock">topDock</a>(), and <a href="q3mainwindow.html#bottomDock">bottomDock</a>().</p>
<h3 class="fn"><a name="setAppropriate"></a>void Q3MainWindow::setAppropriate ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i>, bool <i>a</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
<p>Use this function to control whether or not the <i>dw</i> dock window's caption should appear as a menu item on the dock window menu that lists the dock windows.</p>
<p>If <i>a</i> is true then the <i>dw</i> will appear as a menu item on the dock window menu. The user is able to change the state (show or hide) a dock window that has a menu item by clicking the item; depending on the state of your application, this may or may not be appropriate. If <i>a</i> is false the <i>dw</i> will not appear on the popup menu.</p>
<p>See also <a href="q3mainwindow.html#appropriate">appropriate</a>(), <a href="q3mainwindow.html#showDockMenu">showDockMenu</a>(), <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>(), and <a href="q3mainwindow.html#customize">customize</a>().</p>
<h3 class="fn"><a name="setCentralWidget"></a>void Q3MainWindow::setCentralWidget ( <a href="qwidget.html">QWidget</a> * <i>w</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Sets the central widget for this main window to <i>w</i>.</p>
<p>The central widget is surrounded by the left, top, right and bottom dock areas. The menu bar is above the top dock area.</p>
<p>See also <a href="q3mainwindow.html#centralWidget">centralWidget</a>().</p>
<h3 class="fn"><a name="setDockEnabled"></a>void Q3MainWindow::setDockEnabled ( <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>dock</i>, bool <i>enable</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>If <i>enable</i> is true then users can dock windows in the <i>dock</i> area. If <i>enable</i> is false users cannot dock windows in the <i>dock</i> dock area.</p>
<p>Users can dock (drag) dock windows into any enabled dock area.</p>
<p>See also <a href="q3mainwindow.html#isDockEnabled">isDockEnabled</a>().</p>
<h3 class="fn"><a name="setDockEnabled-2"></a>void Q3MainWindow::setDockEnabled ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i>, <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>dock</i>, bool <i>enable</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>If <i>enable</i> is true then users can dock the <i>dw</i> dock window in the <i>dock</i> area. If <i>enable</i> is false users cannot dock the <i>dw</i> dock window in the <i>dock</i> area.</p>
<p>In general users can dock (drag) dock windows into any enabled dock area. Using this function particular dock areas can be enabled (or disabled) as docking points for particular dock windows.</p>
<h3 class="fn"><a name="setDockMenuEnabled"></a>void Q3MainWindow::setDockMenuEnabled ( bool <i>b</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
<p>If <i>b</i> is true, then right clicking on a dock window or dock area will pop up the dock window menu. If <i>b</i> is false, right clicking a dock window or dock area will not pop up the menu.</p>
<p>The menu lists the (<a href="q3mainwindow.html#appropriate">appropriate</a>()) dock windows (which may be shown or hidden), and has a &quot;Line Up Dock Windows&quot; item. It will also have a &quot;Customize&quot; menu item if <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() returns true.</p>
<p>See also <a href="q3mainwindow.html#lineUpDockWindows">lineUpDockWindows</a>() and <a href="q3mainwindow.html#isDockMenuEnabled">isDockMenuEnabled</a>().</p>
<h3 class="fn"><a name="setToolBarsMovable"></a>void Q3MainWindow::setToolBarsMovable ( bool <i>b</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>If <i>b</i> is true the tool bars can be moved.</p>
<p>See also <a href="q3mainwindow.html#toolBarsMovable">toolBarsMovable</a>().</p>
<h3 class="fn"><a name="setUpLayout"></a>void Q3MainWindow::setUpLayout ()&nbsp;&nbsp;<tt> [virtual protected slot]</tt></h3>
<p>Sets up the geometry management of the window. It is called automatically when needed, so you shouldn't need to call it.</p>
<h3 class="fn"><a name="showDockMenu"></a>bool Q3MainWindow::showDockMenu ( const <a href="qpoint.html">QPoint</a> &amp; <i>globalPos</i> )&nbsp;&nbsp;<tt> [virtual protected slot]</tt></h3>
<p>Shows the dock menu at the position <i>globalPos</i>. The menu lists the dock windows so that they can be shown (or hidden), lined up, and possibly customized. Returns true if the menu is shown; otherwise returns false.</p>
<p>If you want a custom menu, reimplement this function. You can create the menu from scratch or call <a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a>() and modify the result.</p>
<p>The default implementation uses the dock window menu which gets created by <a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a>(). You can reimplement <a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a>() if you want to use your own specialized popup menu.</p>
<h3 class="fn"><a name="statusBar"></a><a href="qstatusbar.html">QStatusBar</a> * Q3MainWindow::statusBar () const</h3>
<p>Returns this main window's status bar. If there isn't one, statusBar() creates an empty status bar, and if necessary a tool tip group too.</p>
<p>See also <a href="q3mainwindow.html#menuBar">menuBar</a>().</p>
<h3 class="fn"><a name="toolBarPositionChanged"></a>void Q3MainWindow::toolBarPositionChanged ( <a href="q3toolbar.html">Q3ToolBar</a> * <i>toolbar</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when a <i>toolbar</i> is moved.</p>
<h3 class="fn"><a name="toolBars"></a><a href="qlist.html">QList</a>&lt;<a href="q3toolbar.html">Q3ToolBar</a> *&gt; Q3MainWindow::toolBars ( <a href="qt-qt3.html#Dock-enum">Qt::Dock</a> <i>dock</i> ) const</h3>
<p>Returns a list of all the toolbars which are in the <i>dock</i> dock area, regardless of their state.</p>
<p>For example, the <tt>TornOff</tt> dock area may contain closed toolbars but these are returned along with the visible toolbars.</p>
<p>See also <a href="q3mainwindow.html#dockWindows">dockWindows</a>().</p>
<h3 class="fn"><a name="toolBarsMovable"></a>bool Q3MainWindow::toolBarsMovable () const</h3>
<p>Returns true if the window allows its toolbars to be moved; otherwise returns false.</p>
<p>See also <a href="q3mainwindow.html#setToolBarsMovable">setToolBarsMovable</a>().</p>
<h3 class="fn"><a name="topDock"></a><a href="q3dockarea.html">Q3DockArea</a> * Q3MainWindow::topDock () const</h3>
<p>Returns the <tt>Top</tt> dock area</p>
<p>See also <a href="q3mainwindow.html#bottomDock">bottomDock</a>(), <a href="q3mainwindow.html#leftDock">leftDock</a>(), and <a href="q3mainwindow.html#rightDock">rightDock</a>().</p>
<h3 class="fn"><a name="usesTextLabelChanged"></a>void Q3MainWindow::usesTextLabelChanged ( bool <i>b</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the <a href="q3mainwindow.html#usesTextLabel-prop">setUsesTextLabel</a>() is called with a value different to the current setting. The new value is passed in <i>b</i>. All widgets that should respond to such changes, e.g&#x2e; toolbar buttons, must connect to this signal.</p>
<h3 class="fn"><a name="whatsThis"></a>void Q3MainWindow::whatsThis ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
<p>Enters 'What's This?' mode and returns immediately.</p>
<p>This is the same as <a href="qwhatsthis.html#enterWhatsThisMode">QWhatsThis::enterWhatsThisMode</a>(), but implemented as a main window object's slot. This way it can easily be used for popup menus, for example:</p>
<pre> Q3PopupMenu * help = new Q3PopupMenu(this);
 help-&gt;insertItem(&quot;What's &amp;This&quot;, this , SLOT(enterWhatsThis()), Qt::SHIFT+Qt::Key_F1);</pre>
<p>See also <a href="q3whatsthis.html#enterWhatsThisMode">Q3WhatsThis::enterWhatsThisMode</a>().</p>
<hr />
<h2>Related Non-Members</h2>
<h3 class="fn"><a name="operator-lt-lt-118"></a><a href="qtextstream.html">QTextStream</a> &amp; operator&lt;&lt; ( <a href="qtextstream.html">QTextStream</a> &amp; <i>ts</i>, const Q3MainWindow &amp; <i>mainWindow</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Writes the layout (sizes and positions) of the dock windows in the dock areas of the <a href="q3mainwindow.html">Q3MainWindow</a> <i>mainWindow</i>, including <tt>Minimized</tt> and <tt>TornOff</tt> dock windows, to the text stream <i>ts</i>.</p>
<p>This can be used, for example, in conjunction with <a href="qsettings.html">QSettings</a> to save the user's layout when the <i>mainWindow</i> receives a close event.</p>
<p>See also <a href="qwidget.html#closeEvent">QWidget::closeEvent</a>().</p>
<h3 class="fn"><a name="operator-gt-gt-68"></a><a href="qtextstream.html">QTextStream</a> &amp; operator&gt;&gt; ( <a href="qtextstream.html">QTextStream</a> &amp; <i>ts</i>, Q3MainWindow &amp; <i>mainWindow</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Reads the layout (sizes and positions) of the dock windows in the dock areas of the <a href="q3mainwindow.html">Q3MainWindow</a> <i>mainWindow</i> from the text stream, <i>ts</i>, including <tt>Minimized</tt> and <tt>TornOff</tt> dock windows. Restores the dock windows and dock areas to these sizes and positions. The layout information must be in the format produced by operator&lt;&lt;().</p>
<p>This can be used, for example, in conjunction with <a href="qsettings.html">QSettings</a> to restore the user's layout.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
